package ad.android.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import ad.android.util.Constants;

/**
 * TblAdhost entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tbl_adhost", catalog = Constants.CATALOG, uniqueConstraints = @UniqueConstraint(columnNames = "ADHOST_EMAIL"))
public class AdHost implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 5019701944457928280L;
	private Long id;
	private String adHostName;
	private String adhostSex;
	private String adhostEmail;
	private String adhostPhone;
	private String adhostPassword;
	private String adhostMobilePhone;
	private Set<Company> tblCompanies = new HashSet<Company>(0);
	private Set<Ad> tblAds = new HashSet<Ad>(0);

	/**
	 * 手机号码
	 */
	private String mobileNum;
	/**
	 *qq
	 */
	private String qq;
	/**
	 * msn
	 */
	private String msn;
	/**
	 * 地址
	 */
	private String address;
	/**
	 * 邮政编码
	 */
	private String postalCode;
	/**
	 * 昵称
	 */
	private String nikeName;
	/**
	 *固定电话
	 */
	private String telphone;
	/**
	 * 公司名称
	 */
	private String companyName;
	/**
	 *公司网站
	 */
	private String companySite;
	/**
	 *公司地址
	 */
	private String companyAddress;
	
	// Constructors

	/** default constructor */
	public AdHost() {
	}

	/** full constructor */
	public AdHost(String adHostName, String adhostSex, String adhostEmail,
			String adhostPhone, String adhostMobilePhone,
			Set<Company> tblCompanies, Set<Ad> tblAds) {
		this.adHostName = adHostName;
		this.adhostSex = adhostSex;
		this.adhostEmail = adhostEmail;
		this.adhostPhone = adhostPhone;
		this.adhostMobilePhone = adhostMobilePhone;
		this.tblCompanies = tblCompanies;
		this.tblAds = tblAds;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "ID", unique = true, nullable = true)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "ADHOST_NAME", length = 200)
	public String getAdHostName() { 
		return this.adHostName;
	}

	public void setAdHostName(String adHostName) {
		this.adHostName = adHostName;
	}

	@Column(name = "ADHOST_SEX", length = 1)
	public String getAdhostSex() {
		return this.adhostSex;
	}

	public void setAdhostSex(String adhostSex) {
		this.adhostSex = adhostSex;
	}

	@Column(name = "ADHOST_EMAIL", unique = true, length = 200)
	public String getAdhostEmail() {
		return this.adhostEmail;
	}

	public void setAdhostEmail(String adhostEmail) {
		this.adhostEmail = adhostEmail;
	}

	@Column(name = "ADHOST_PHONE", length = 200)
	public String getAdhostPhone() {
		return this.adhostPhone;
	}

	public void setAdhostPhone(String adhostPhone) {
		this.adhostPhone = adhostPhone;
	}

	@Column(name = "ADHOST_MOBILE_PHONE", length = 200)
	public String getAdhostMobilePhone() {
		return this.adhostMobilePhone;
	}

	public void setAdhostMobilePhone(String adhostMobilePhone) {
		this.adhostMobilePhone = adhostMobilePhone;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tblAdhost")
	public Set<Company> getTblCompanies() {
		return this.tblCompanies;
	}

	public void setTblCompanies(Set<Company> tblCompanies) {
		this.tblCompanies = tblCompanies;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tblAdhost")
	public Set<Ad> getTblAds() {
		return this.tblAds;
	}

	public void setTblAds(Set<Ad> tblAds) {
		this.tblAds = tblAds;
	}
	@Column(name = "ADHOST_PASSWORD")
	public String getAdhostPassword() {
		return adhostPassword;
	}

	public void setAdhostPassword(String adhostPassword) {
		this.adhostPassword = adhostPassword;
	}
	
	@Column(name = "ADHOST_ADDRESS", length = 200)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	@Column(name = "ADHOST_COMPANY_ADDRESS", length = 200)
	public String getCompanyAddress() {
		return companyAddress;
	}

	public void setCompanyAddress(String companyAddress) {
		this.companyAddress = companyAddress;
	}
	@Column(name = "ADHOST_COMPANY_NAME", length = 200)
	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}
	@Column(name = "ADHOST_COMPANY_SITE", length = 200)
	public String getCompanySite() {
		return companySite;
	}

	public void setCompanySite(String companySite) {
		this.companySite = companySite;
	}
	@Column(name = "ADHOST_MOBILENUM", length = 20)
	public String getMobileNum() {
		return mobileNum;
	}

	public void setMobileNum(String mobileNum) {
		this.mobileNum = mobileNum;
	}
	@Column(name = "ADHOST_MSN", length = 20)
	public String getMsn() {
		return msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}
	@Column(name = "ADHOST_NIKENAME", length = 50)
	public String getNikeName() {
		return nikeName;
	}

	public void setNikeName(String nikeName) {
		this.nikeName = nikeName;
	}
	@Column(name = "ADHOST_POSTALCODE", length = 50)
	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}
	@Column(name = "ADHOST_QQ", length = 50)
	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}
	@Column(name = "ADHOST_TELPHONE", length = 50)
	public String getTelphone() {
		return telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

}